package com.lin.dao;

import com.lin.pojo.Category;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * ClassName:CategoryDao
 * Package:com.lin.dao
 * Author: hellcat
 * Date: 2019/12/22
 * ♣♣♣
 */
public interface CategoryDao {
    List<Category> listCategory(@Param("storeId") int storeId);

    List<Category> listCategory1(@Param("storeId") int storeId);

    List<Category> listCategory2(@Param("parentCategoryId") Integer parentCategoryId,
                                 @Param("storeId") int storeId);

    void insertCategory(Category category);

    void updateCategory(Category category);

    void deleteCategory(Category category);


    //查询分类是否已存在
    List<Category> getCategoryByCategoryNameAndParentId(@Param("categoryName") String categoryName,
                                                        @Param("parentCategoryId") String parentCategoryId,
                                                        @Param("storeId") int storeId);


    String getCategoryNameById(@Param("categoryId") String categoryId,
                               @Param("storeId") int storeId);


    //    查询分类下是商品数量
    int getTotalByCategoryId(Category category);

}
